package net.huashitong.supervision.task.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.supervision.task.dao.ScoreLevelDao;
import net.huashitong.supervision.task.entity.ScoreLevel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created with IntelliJ IDEA.
 *
 * @author ling
 * @date: 2020/3/5
 * @time: 16:05
 * @version: 1.0
 * @Description:
 */
@Service
public class ScoreLevelService extends StringPKService<ScoreLevel> {
    @Autowired
    private ScoreLevelDao dao;
    @Autowired
    private SysTableService sysTableService;
    @Override
    protected BaseDao<ScoreLevel, String> getDao() {
        return dao;
    }
    @Override
    protected void beforeSave(ScoreLevel obj) {
        obj.setSysId(sysTableService.updateMaxSysId("t_score_level",null));
    }
}
